package com.hbnu.exercise.basic;

import java.util.Scanner;

public class Demo03_Year
{
    public static void main(String[] args)
    {
        Scanner scanner = new Scanner(System.in);
        int year, month, day, days = 0;
        int[] months = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};
        boolean isLeap;
        year = scanner.nextInt();
        month = scanner.nextInt();
        day = scanner.nextInt();
        isLeap = (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
        for (int i = 0; i < month; i++)
            days += months[i];
        days += day;
        if (isLeap && month > 2)
            ++days;
        System.out.println(year + "的第" + days + "天");
    }
}
